package com.example.rdcproject.ving.notes.view.Admin;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class AdminInteractionView extends JFrame{


     public AdminInteractionView(){
         JFrame frame = new JFrame("管理员功能主页面");
         JPanel panel = new JPanel();


         frame.add(panel);

         frame.setSize(500, 500);

         // 设置窗口相对指定主键位置
         frame.setLocationRelativeTo(null);

         // 设置窗口关闭操作
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


         //添加按钮
         JButton operateBookButton = new JButton("对单词书的操作");
         operateBookButton.setBounds(80,80,60,60);
         panel.add(operateBookButton);

         JButton selectAlllButton = new JButton("查询所有个人信息");
         selectAlllButton.setBounds(250,80,60,60);
         panel.add(selectAlllButton);

         JButton selectBookButton = new JButton("查询所有单词书");
         selectBookButton.setBounds(80,250,60,60);
         panel.add(selectBookButton);

         JButton boardButton = new JButton("编辑公告栏");
         boardButton.setBounds(250,250,60,60);
         panel.add(boardButton);

         JButton blackButton = new JButton("管理黑名单");
         blackButton.setBounds(80,350,60,60);
         panel.add(blackButton);

         operateBookButton.addActionListener(new ActionListener() {
             @Override
             public  void actionPerformed(ActionEvent e) {
                 WordBookView wordBookView = new WordBookView();
                 wordBookView.setVisible(true);

             }
         });

         selectAlllButton.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
                SelectAllView selectAllView = new SelectAllView();
                selectAllView.setVisible(true);
             }
         });

         selectBookButton.addActionListener(new ActionListener(){
            @Override
            public void actionPerformed(ActionEvent e){
                BooksView bookView = new BooksView();
            }
         });

         boardButton.addActionListener(new ActionListener(){
             @Override
             public void actionPerformed(ActionEvent e){
                AnnouncementBoardView announcementBoardView = new AnnouncementBoardView();

             }
         });

         blackButton.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e){
                 BlackView blackView = new BlackView();
                 blackView.setVisible(true);
             }
         });

         frame.pack();
         frame.setVisible(true);

     }

}
